import Vue from "vue";

const store = {
  namespaced: true,
  state: {
    editMessage: null,
  },

  setState(key, val) {
    Vue.set(this.state, key, val);
  },
};

function mapState(keys) {
  const map = {};
  keys.forEach((key) => {
    map[key] = function () {
      return store.state[key];
    };
  });
  return map;
}

export default store;
export { mapState };
